home *** CD-ROM | disk | FTP | other *** search
/ MacPeople 2001 February 15 / MACPEOPLE-2001-02-15.ISO.7z / MACPEOPLE-2001-02-15.ISO / オンラインウエア / 厳選オンラインウエア100 / マルチメディア / iView Multimedia 3.8.4ト.sea / iView Multimedia 3.8.4ƒ / AppleScript Support / folder watch script next >
Text File  |  2000-01-30  |  847b  |  37 lines

  1. on adding folder items to theFolder after receiving addedItems
  2.     
  3.     -- name of catalog file
  4.     set myCatalog to (theFolder as text) & ".catalog"
  5.     
  6.     -- check if we already have a catalog    
  7.     tell application "Finder"
  8.         set fileExists to exists alias (myCatalog)
  9.     end tell
  10.     
  11.     -- confirm
  12.     display dialog "Insert items in '.catalog'" -- & (myCatalog as text) & "'"
  13.     
  14.     tell application "iView Multimedia"
  15.         activate
  16.         
  17.         -- if catalog exists we insert new items, otherwise we insert entire folder
  18.         if fileExists = true then
  19.             open file myCatalog
  20.             open addedItems
  21.         else
  22.             open theFolder
  23.         end if
  24.         
  25.         -- wait until importing is done
  26.         repeat while the ヌclass pImpネ of window 1 is true
  27.         end repeat
  28.         
  29.         -- save catalog
  30.         if fileExists = true then
  31.             save window 1
  32.         else
  33.             save window 1 in file myCatalog
  34.         end if
  35.     end tell
  36.     
  37. end adding folder items to